package com.zscat.mallplus.thread;

import com.zscat.mallplus.dms.entity.DmsOrder;
import com.zscat.mallplus.dms.service.WxMsgService;
import com.zscat.mallplus.qsg.QsgRechargeOrder;

public class WxMsgThread implements Runnable{

    private WxMsgService wxMsgService;

    private DmsOrder dmsOrder;

    private QsgRechargeOrder rechargeOrder;

    private int integral;

    public WxMsgThread(WxMsgService wxMsgService,QsgRechargeOrder rechargeOrder) {
        this.wxMsgService = wxMsgService;
        this.rechargeOrder = rechargeOrder;
    }

    public WxMsgThread(WxMsgService wxMsgService, DmsOrder dmsOrder) {
        this.wxMsgService = wxMsgService;
        this.dmsOrder = dmsOrder;
    }

    public WxMsgThread(WxMsgService wxMsgService, QsgRechargeOrder rechargeOrder,Integer integral) {
        this.wxMsgService = wxMsgService;
        this.rechargeOrder = rechargeOrder;
        this.integral = integral;
    }

    @Override
    public void run() {
        if (null!=dmsOrder){
            wxMsgService.sendSubscribeMsg(dmsOrder);
        }
        if (null!=rechargeOrder){
            wxMsgService.sendRecharge(rechargeOrder,integral);
        }
    }
}
